import { $post } from '@/utils/request';
import {
  ERPLogSearchParam,
  ERPLogChangedParam,
  ERPFuncLogParam,
  WmsDeliverySendParam,
  BoxMaterialSendParam,
  DistributedBoxMaterialSendParam,
  WmsLogSendParam,
  wmsDeliveryTicketSendParam,
  boxDataQueryParam,
  DistributedBoxExpendParam,
} from './types';

// erp日志查看
export function ERPLogSearch(data: ERPLogSearchParam) {
  return $post('/erpLogRest/querySendErpLog', data);
}

// erp日志查看
export function ERPLogDelete(data: any) {
  return $post('/erpLogRest/deleteLog', data);
}

// erp日志推送
export function ERPLogSend(data: any) {
  return $post('/erpLogRest/reSendLog', data);
}

// erp日志修改
export function ERPLogChanged(data: ERPLogChangedParam) {
  return $post('/erpLogRest/updateMsg', data);
}

// erp 操作日志返回
export function ERPFuncLog(data: ERPFuncLogParam) {
  return $post('/erpLogRest/queryBackLog', data);
}

// 配送查询
export function wmsDeliverySend(data: WmsDeliverySendParam) {
  return $post('/MESLogResend/searchDispatchedData', data);
}

// 配送查询-重新配送
export function wmsDeliveryResend(data: any) {
  return $post('/MESLogResend/reSendToMES', data);
}

// 缓存箱物料查询
export function boxMaterialSend(data: BoxMaterialSendParam) {
  return $post('/synthesizeQueryRest/queryWorkbinParent', data);
}

// 分配缓存箱物料查询
export function distributedBoxMaterialSend(
  data: DistributedBoxMaterialSendParam
) {
  return $post('/synthesizeQueryRest/queryWorkbinReceParent', data);
}

// 日志查询
export function wmsLogSend(data: WmsLogSendParam) {
  return $post('/synthesizeQueryRest/queryGkLog', data);
}

// 交接单查询
export function wmsDeliveryTicketSend(data: wmsDeliveryTicketSendParam) {
  return $post('/DeliveryPlanQuery/ParamsByDeliveryQuery', data);
}

// 修改交接单数据
export function wmsDeliveryTicketDataChanged(data: any) {
  return $post('/DeliveryPlanQuery/updateWmsDelivery', data);
}

// 修改交接单数据
export function wmsDeliveryTicketStatusChanged(data: any) {
  return $post('/DeliveryPlanQuery/updateWmsDeliveryStatus', data);
}

// 缓存箱查询
export function boxDataQuery(data: boxDataQueryParam) {
  return $post('/msworkbin/queryWorkbinMaterial', data);
}

// 缓存箱数据修改
export function boxDataUpdate(data: any) {
  return $post('/msworkbin/updateWorkbinMaterial', data);
}

// 缓存箱设置为空箱
export function boxDataSetEmpty(data: any) {
  return $post('/msworkbin/SetEmptyBoxes', data);
}

// 综合查询-分配缓存箱查询展开数据
export function distributedBoxExpendQuery(data: DistributedBoxExpendParam) {
  return $post('/synthesizeQueryRest/queryWorkbinReceChild', data);
}

// 综合查询-缓存箱物料查询展开数据
export function materialBoxExpendQuery(data: DistributedBoxExpendParam) {
  return $post('/synthesizeQueryRest/queryWorkbinChild', data);
}

// WMS与CEMOP接口日志
export function getLogPage(data: any) {
  return $post('/InterFace/getInterFaceList', data);
}

// WMS接口日志
export function getWmsLog(data: any) {
  return $post('/localLog/getLogPage', data);
}
